package com.risk.kernel.service.impl;

import com.risk.kernel.domain.KfConfig;
import com.risk.kernel.mapper.KfConfigMapper;
import com.risk.kernel.service.IKfConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author: Liwen
 * @createTime: 2024/11/21
 * @description:
 */
@Service
public class KfConfigServiceImpl implements IKfConfigService {
    @Autowired
    private KfConfigMapper kfConfigMapper;

    /**
     * 查询【请填写功能名称】
     *
     * @param id 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    @Override
    public KfConfig selectKfConfigById(Long id) {
        KfConfig kfConfig = kfConfigMapper.selectKfConfigById(id);

        return kfConfig;
    }

    /**
     * 查询列表
     *
     * @param keys
     * @return
     */
    @Override
    public List<KfConfig> selectKfConfigList(String keys) {
        List<KfConfig> list = kfConfigMapper.selectKfConfigList(keys);
        return list;
    }

    /**
     * 新增
     *
     * @param kfConfig
     * @return 结果
     */
    @Override
    public int insertKfConfig(KfConfig kfConfig) {
        return kfConfigMapper.insertKfConfig(kfConfig);
    }

    /**
     * 修改【请填写功能名称】
     *
     * @param kfConfig 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateKfConfig(KfConfig kfConfig) {

        return kfConfigMapper.updateKfConfig(kfConfig);
    }

    /**
     * 批量删除【请填写功能名称】
     *
     * @param ids 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteKfConfigByIds(Long[] ids) {
        return kfConfigMapper.deleteKfConfigByIds(ids);
    }

    /**
     * 删除【请填写功能名称】信息
     *
     * @param id 【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteKfConfigById(Long id) {
        return kfConfigMapper.deleteKfConfigById(id);
    }


    /*public String execModelName(String modelName) {
        if (modelName.equals("1")) {
            modelName = "新核心";
        } else if (modelName.equals("2")) {
            modelName = "老核心";
        } else if (modelName.equals("3")) {
            modelName = "emc";
        } else if (modelName.equals("4")) {
            modelName = "yika";
        }
        if ("new".equals(modelName)) {
            modelName = "1";
        } else if ("old".equals(modelName)) {
            modelName = "2";
        } else if ("emc".equals(modelName)) {
            modelName = "3";
        } else if ("yika".equals(modelName)) {
            modelName = "4";
        }

        return modelName;

    }*/
}
